import vec

WIDTH = 250
HEIGHT = 250

BACK_COLOR = (0, 0, 127)
CIRCLE_COLOR = (0, 200, 0)

class MyCircle:
    def __init__(self, pos, r):
        self.pos = pos
        self.r = r

    def Draw(self):
        screen.draw.filled_circle((self.pos.x, self.pos.y), self.r, CIRCLE_COLOR)


def on_key_down(key):
    if key == keys.ESCAPE:
        quit() 
        
def on_mouse_down(pos):
    print("mouse_down", pos)
    
def on_mouse_up(pos):
    print("mouse_up", pos)


start_pt = vec.Vec2(50, 50)
end_pt = vec.Vec2(200, 200)
full_dist = (end_pt - start_pt).length()
c = MyCircle(start_pt, 30)
spd = 3
p = 0
pspd = 3 / full_dist

def update():
    global p
    if p < 1.0:    
        p += pspd
    else:
        p = 1.0
    c.pos = start_pt * (1 - p) + end_pt * p
        
def draw():
    screen.fill(BACK_COLOR)
    c.Draw()
